Remove the error parameter to the gtk_recent_manager_add() and
authorEmmanuele Bassi <ebassi@cvs.gnome.org>
Fri, 12 May 2006 08:37:07 +0000 (08:37 +0000)
committerEmmanuele Bassi <ebassi@src.gnome.org>
Fri, 12 May 2006 08:37:07 +0000 (08:37 +0000)
2006-05-11  Emmanuele Bassi  <ebassi@cvs.gnome.org>

* gtk/gtkrecentmanager.h: Remove the error parameter to the
gtk_recent_manager_add() and gtk_recent_manager_add_full()
functions; remove the unneeded error codes from the error
enumeration.  (#336774).

* gtk/gtkrecentmanager.c: Make gtk_recent_manager_add() and
gtk_recent_manager_add_full() complain loudly about wrong or
missing meta-data, instead of using a GError.  (#336774)

ChangeLog
ChangeLog.pre-2-10
gtk/gtkrecentmanager.c
gtk/gtkrecentmanager.h

index 0b5458bc7d5fbd2b8925dcc37619e6a83ec2761b..41a0dd869ddea6311a5423117ccfdc1469b53b98 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-05-11  Emmanuele Bassi  <ebassi@cvs.gnome.org>
+
+       * gtk/gtkrecentmanager.h: Remove the error parameter to the
+       gtk_recent_manager_add() and gtk_recent_manager_add_full()
+       functions; remove the unneeded error codes from the error
+       enumeration.  (#336774).
+
+       * gtk/gtkrecentmanager.c: Make gtk_recent_manager_add() and
+       gtk_recent_manager_add_full() complain loudly about wrong or
+       missing meta-data, instead of using a GError.  (#336774)
+
 2006-05-11  Matthias Clasen  <mclasen@redhat.com>
 
        * demos/gtk-demo/Makefile.am (demos): Add it here.
index 0b5458bc7d5fbd2b8925dcc37619e6a83ec2761b..41a0dd869ddea6311a5423117ccfdc1469b53b98 100644 (file)
@@ -1,3 +1,14 @@
+2006-05-11  Emmanuele Bassi  <ebassi@cvs.gnome.org>
+
+       * gtk/gtkrecentmanager.h: Remove the error parameter to the
+       gtk_recent_manager_add() and gtk_recent_manager_add_full()
+       functions; remove the unneeded error codes from the error
+       enumeration.  (#336774).
+
+       * gtk/gtkrecentmanager.c: Make gtk_recent_manager_add() and
+       gtk_recent_manager_add_full() complain loudly about wrong or
+       missing meta-data, instead of using a GError.  (#336774)
+
 2006-05-11  Matthias Clasen  <mclasen@redhat.com>
 
        * demos/gtk-demo/Makefile.am (demos): Add it here.
index bf469dd6dc86056d792b775b3514a81a15db5898..371db0ff7a50c643fb096c4d252aff94720e9a02 100644 (file)
@@ -812,7 +812,6 @@ gtk_recent_manager_get_limit (GtkRecentManager *manager)
  * gtk_recent_manager_add_item:
  * @manager: a #GtkRecentManager
  * @uri: a valid URI
- * @error: return location for a #GError, or %NULL
  *
  * Adds a new resource, pointed by @uri, into the recently used
  * resources list.
@@ -831,8 +830,7 @@ gtk_recent_manager_get_limit (GtkRecentManager *manager)
  */
 gboolean
 gtk_recent_manager_add_item (GtkRecentManager  *manager,
-                            const gchar       *uri,
-                            GError           **error)
+                            const gchar       *uri);
 {
   GtkRecentData *recent_data;
   GError *add_error;
@@ -873,7 +871,7 @@ gtk_recent_manager_add_item (GtkRecentManager  *manager,
   recent_data->is_private = FALSE;
   
   add_error = NULL;
-  retval = gtk_recent_manager_add_full (manager, uri, recent_data, &add_error);
+  retval = gtk_recent_manager_add_full (manager, uri, recent_data);
   
   g_free (recent_data->mime_type);
   g_free (recent_data->app_name);
@@ -881,13 +879,6 @@ gtk_recent_manager_add_item (GtkRecentManager  *manager,
 
   g_slice_free (GtkRecentData, recent_data);
   
-  if (!retval)
-    {
-      g_propagate_error (error, add_error);
-      
-      return FALSE;
-    }
-  
   return retval;
 }
 
@@ -896,7 +887,6 @@ gtk_recent_manager_add_item (GtkRecentManager  *manager,
  * @manager: a #GtkRecentManager
  * @uri: a valid URI
  * @recent_data: metadata of the resource
- * @error: return location for a #GError, or %NULL
  *
  * Adds a new resource, pointed by @uri, into the recently used
  * resources list, using the metadata specified inside the #GtkRecentData
@@ -939,53 +929,47 @@ gtk_recent_manager_add_full (GtkRecentManager     *manager,
   if ((data->display_name) &&
       (!g_utf8_validate (data->display_name, -1, NULL)))
     {
-      g_set_error  (error, GTK_RECENT_MANAGER_ERROR,
-                   GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING,
-                   _("The display name of the recently used resource "
-                     "must be a valid UTF-8 encoded string."));
+      g_warning ("Attempting to add `%s' to the list of recently used "
+                "resources, but the display name is not a valid UTF-8 "
+                "encoded string",
+                uri);
       return FALSE;
     }
   
   if ((data->description) &&
       (!g_utf8_validate (data->description, -1, NULL)))
     {
-      g_set_error (error, GTK_RECENT_MANAGER_ERROR,
-                  GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING,
-                  _("The description of the recently used resource "
-                    "must be a valid UTF-8 encoded string."));
+      g_warning ("Attempting to add `%s' to the list of recently used "
+                "resources, but the description is not a valid UTF-8 "
+                "encoded string",
+                uri);
       return FALSE;
     }
 
  
   if (!data->mime_type)
     {
-      g_set_error (error, GTK_RECENT_MANAGER_ERROR,
-                   GTK_RECENT_MANAGER_ERROR_INVALID_MIME,
-                  _("You must specify the MIME type of the "
-                    "resource pointed by `%s'"),
-                  uri);
+      g_warning ("Attempting to add `%s' to the list of recently used "
+                "resources, but not MIME type was defined",
+                uri);
       return FALSE;
     }
   
   if (!data->app_name)
     {
-      g_set_error (error, GTK_RECENT_MANAGER_ERROR,
-                  GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED,
-                  _("You must specify the name of the application "
-                    "that is registering the recently used resource "
-                    "pointed by `%s'"),
-                  uri);
+      g_warning ("Attempting to add `%s' to the list of recently used "
+                "resources, but no name of the application that is "
+                "registering it was defined"
+                uri);
       return FALSE;
     }
   
   if (!data->app_exec)
     {
-      g_set_error (error, GTK_RECENT_MANAGER_ERROR,
-                   GTK_RECENT_MANAGER_ERROR_BAD_EXEC_STRING,
-                  _("You must specify a command line to "
-                    "be used when launching the resource "
-                    "pointed by `%s'"),
-                  uri);
+      g_warning ("Attempting to add `%s' to the list of recently used "
+                "resources, but no command line for the application "
+                "that is registering it was defined",
+                uri);
       return FALSE;
     }
   
index e85488c22c21bb6ef72a17a5e98cb47c1f6a3200..c09deb286516d5c290ea6c17a1ba4803a31ec357 100644 (file)
@@ -104,8 +104,6 @@ struct _GtkRecentManagerClass
  * @GTK_RECENT_MANAGER_ERROR_NOT_FOUND: the URI specified does not exists in
  *   the recently used resources list.
  * @GTK_RECENT_MANAGER_ERROR_INVALID_URI: the URI specified is not valid.
- * @GTK_RECENT_MANAGER_ERROR_INVALID_MIME: the MIME type specified is not
- *   valid.
  * @GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: the supplied string is not
  *   UTF-8 encoded.
  * @GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: no application has registered
@@ -122,10 +120,8 @@ typedef enum
 {
   GTK_RECENT_MANAGER_ERROR_NOT_FOUND,
   GTK_RECENT_MANAGER_ERROR_INVALID_URI,
-  GTK_RECENT_MANAGER_ERROR_INVALID_MIME,
   GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING,
   GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED,
-  GTK_RECENT_MANAGER_ERROR_BAD_EXEC_STRING,
   GTK_RECENT_MANAGER_ERROR_READ,
   GTK_RECENT_MANAGER_ERROR_WRITE,
   GTK_RECENT_MANAGER_ERROR_UNKNOWN
@@ -145,12 +141,10 @@ void              gtk_recent_manager_set_screen     (GtkRecentManager     *manag
                                                     GdkScreen            *screen);
 
 gboolean          gtk_recent_manager_add_item       (GtkRecentManager     *manager,
-                                                    const gchar          *uri,
-                                                    GError              **error);
+                                                    const gchar          *uri);
 gboolean          gtk_recent_manager_add_full       (GtkRecentManager     *manager,
                                                     const gchar          *uri,
-                                                    const GtkRecentData  *recent_data,
-                                                    GError              **error);
+                                                    const GtkRecentData  *recent_data);
 gboolean          gtk_recent_manager_remove_item    (GtkRecentManager     *manager,
                                                     const gchar          *uri,
                                                     GError              **error);